<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href = "../css/bootstrap.min.css">
    <script type="application/javascript" src="../js/jquery-1.9.0.min.js"></script>
    <script type="application/javascript" src="../js/bootstrap.min.js"></script>
    <title>Title</title>
</head>
<body>
<ul>
    <li><a href="a.html">Link 1</a></li>
    <li><a href="b.html">Link 2</a></li>
    <li><a href="c.html">Link 3</a></li>
</ul>
<button id="removeBtn">remove a1</button>
<button id="emptyUl">empty ul</button>
    <script>
        var sum = 0;
        var arr = [1,2,3,4,5];

        $.each(arr,function (index,value){
            sum+=value;
        });
        alert(sum);

        $("li").each(function (index,element){
            alert($(this).text());
        });

        $("removeBtn").on("click",function (){
            $("#a1").remove();
        });
        $("emptyUl").on("click",function (){
            $("#a2").empty();
        });
    </script>
</body>
</html>